package com.mk.cloud.pt.controller.app;

import act.apidoc.Description;
import act.controller.Controller;
import act.inject.DefaultValue;
import com.mk.cloud.common.domain.GlArea;
import com.mk.cloud.common.interceptor.header.HeaderService;
import com.mk.cloud.common.util.ResUtils;
import org.osgl.mvc.annotation.GetAction;

import javax.inject.Inject;
import java.util.List;

@Controller("app/area")
public class GlAreaController extends HeaderService {

    @Inject
    private GlArea.Mapper glAreaMapper;

    @Description("获取区域")
    @GetAction("list.json")
    public String getAreaList(@Description("父代码") @DefaultValue("000000") String pareacode){
        GlArea area = new GlArea();
        area.setPareacode(pareacode);
        List<GlArea> list = glAreaMapper.template(area);
        return ResUtils.OK(list);
    }
}
